package keni.html.android.framework.metadata;

import java.util.ArrayList;
import java.util.List;

import keni.html.android.framework.connectionChannel.ChannelBase;



public class DataSyncMetadata {
	private String serverUrl;
	private String synchronizerClassName;
	
	public DataSyncMetadata(String serverUrl,String synchronizer)
	{
		this.serverUrl=serverUrl;
		this.synchronizerClassName=synchronizer;
	}
	
	public ChannelBase getConnectionChannel()
	{
		
		try {
			Class classObj= Class.forName(synchronizerClassName);
			ChannelBase channelBase = (ChannelBase)classObj.newInstance();
			return channelBase;
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	
	
	}
	
	class Category{
		private String name;
		private List<Item> items=new ArrayList<Item>();
		
		public void addItem(Item item)
		{
			items.add(item);
		}
		public Category(String name)
		{
			this.name=name;
		}
		
		public String getName()
		{
			return name;
		}
		
		
		class Item{
			private String requestFrom;
			private String saveTo;
			
			public Item(String requestFrom,String saveTo)
			{
				this.requestFrom=requestFrom;
				this.saveTo=saveTo;
			}
			public String getRequestFrom()
			{
				return requestFrom;
			}
			
			public String getSaveTo()
			{
				return saveTo;
			}
		}
	}
}
